package com.caishi.lkx.exam.vo;

import com.caishi.lkx.exam.ienum.type.QuestionType;
import com.caishi.lkx.exam.model.QuestionModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Schema(title = "客户端试题结构表达实体类")
@Setter
@Getter
public class QuestionStructureVo {

    @Schema(title = "id")
    private String id;

    @Schema(title = "题型")
    private QuestionType firstType;

    @Schema(title = "小题型")
    private String type;

    @Schema(hidden = true)
    private List<QuestionStructureVo> children;


    public static QuestionStructureVo modelTrans(QuestionModel model) {
        QuestionStructureVo vo = new QuestionStructureVo();
        vo.setId(model.getId());
        vo.setFirstType(model.getFirstType());
        vo.setType(model.getTypeId());
        return vo;
    }
}
